<template>
    <div class="ggitem">
        <div class="name alignleft">
            <div class="ggcontent">
                <a @click.stop="checklogin(item.ggurl)">{{item.ggname}}</a>
                <p class="description">
                    <span class="blue" style="margin-right: 10px;">{{item.xiangmu}}</span>
                    <span class="yellow" v-if="item.ggbmstart && item.ggbmend">报名时间：{{item.ggbmstart}}-{{item.ggbmend}}</span>
                </p>
            </div>
        </div>
    </div>
</template>

<script>
    import moment from 'moment';
    export default {
        props:{
            item:{ type: Object, default: () => {} },
        },
        name: "ggcard",
        data () {
            return {
                moment: moment,
            }
        },
        created(){
        },
        computed:{
            userdata(){
                return this.$store.getters.userdata ? this.$store.getters.userdata : '';
            },
        },
        methods: {
            checklogin(url) {
                var that = this
                if (!that.userdata) {
                    that.$dialog.confirm({
                        title: '提示', message: '请先登录', confirmButtonText: '前往登陆', cancelButtonText: '取消'
                    }).then(() => {
                        this.$router.push({ path: '/user/login' });
                    }).catch(() => {
                    });
                    return
                }
                window.location.href = url
            },
        }
    };
</script>

<style scoped>
</style>